<script setup lang="ts">
import { inject } from 'vue';


// 接收数据
const money = inject('money')
const payMoney = inject<(count:number)=>void>('payMoney')
</script>

<template>
  <div class="child-page" style="padding: 50px; 
  border: 10px solid #ccc">
   孙子组件
  <div>钱包：{{ money }}</div>
  <button @click="payMoney && payMoney(1000)">花钱</button>
  </div>
</template>